package hot_100;

public class 搜索插入位置 {
    public static void main(String[] args) {

    }

    public int searchInsert(int[] nums, int target) {
        int n = nums.length;
        int l = 0, r = n;
        while (r > l) {
            int mid = (r + l) >> 1;
            if (nums[mid] >= target)
                r = mid;
            else
                l = mid + 1;
        }
        return r;
    }
}
